<?php 
$cs=Yii::app()->clientScript;
$baseUrl=Yii::app()->request->baseUrl;
//公司 代理 level=4 个人代理 level=7
// 公司下的职工代理 level=5
$id=yii::app()->user->id;
$custom=Custom::model()->find('user_id='.$id);
$custom_id=$custom->custom_id;
?>
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.2)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.2)">
<title><?php echo Yii::t('base','NetCube Account System'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="<?php echo Yii::app()->request->baseUrl; ?>/css/images/favicon.png">
<!-- Le styles -->
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/twitter/bootstrap.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/base.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/twitter/responsive.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery-ui-1.8.23.custom.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/customer.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/zhiye.css" rel="stylesheet">
<link href="<?php echo Yii::app()->request->baseUrl; ?>/js/fancybox/jquery.fancybox.css" rel="stylesheet">
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/plugins/modernizr.custom.32549.js"></script>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->
</head>
<body>
<div id="loading">
  <img src="<?php echo $baseUrl; ?>/img/ajax-loader.gif">
</div>
<div id="responsive_part">
    <div class="logo">
      <a href="index.html"></a>
    </div>
    <ul class="nav responsive">
      <li>
      <btn class="btn btn-la1rge btn-i1nfo responsive_menu icon_item" data-toggle="collapse" data-target="#sidebar">
       <i class="icon-reorder"></i>
      </btn>
      </li>
    </ul>
</div> <!-- Responsive part -->

<div id="sidebar" class="collapse">
   <div class="logo">
    <a href="<?php echo $baseUrl; ?>"></a>
  </div>
  <?php 
$this->widget('application.extensions.ZY_Menu', array(
		'id'=>'sidebar_menu',
		'htmlOptions'=>array('class'=>'navbar nav nav-list sidebar_box'),
		'activateParents'=>true,
	    'items'=>array(
	    	array(
	    				'label'=>Yii::t('base','HOME'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
	    				'url'=>array('#collapse4'),
	    				'itemOptions'=>array('class'=>'accordion-group'),
	    				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
	    				'submenuOptions'=>array('class'=>((Yii::app()->user->level2()=='2'||Yii::app()->user->level2()=='3') && $this->id!=agentcompany) || $this->id==='userService' || $this->id==='contactList'  || $this->id==='loginList'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse4'),
	    				'items'=>array(
	    						array('label'=>Yii::t('base','Manage User'), 'url'=>array('user/admin','level'=>2)),
	    					//	array('label'=>Yii::t('base','Create Top User'), 'url'=>array('user/create','level'=>2),'visible'=>Yii::app()->user->level()==1),
	    					//	array('label'=>Yii::t('base','Create sub User'), 'url'=>array('user/create','level'=>3),'visible'=>Yii::app()->user->level()==2),
	    						array('label'=>Yii::t('base','Application Sharing Management'), 'url'=>array('contactList/admin'),'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)),
	    						array('label'=>Yii::t('base','Manage Account List'), 'url'=>array('loginList/admin'),'visible'=>(Yii::app()->user->level()==1)),
	    				),'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)||(Yii::app()->user->level()==3)),
	    		array(
	    				'label'=>Yii::t('base','Test'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
	    				'url'=>array('testactivity/admin'),
	    				'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)||(Yii::app()->user->level()==3)),
	    		array(
	    				'label'=>Yii::t('base','Custom'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
	    				'url'=>array('#collapse11'),
	    				'itemOptions'=>array('class'=>'accordion-group'),
	    				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
	    				'submenuOptions'=>array('class'=>$this->id==='custom'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse11'),
	    				'items'=>array(
	    						array('label'=>Yii::t('base','Manage sold Custom'), 'url'=>array('custom/admin','isreback'=>0)),
	    						array('label'=>Yii::t('base','Manage Historical Custom'), 'url'=>array('custom/admin','isreback'=>1)),
	    					//	array('label'=>Yii::t('base','Create Custom'), 'url'=>array('custom/create'),'visible'=>(Yii::app()->user->level()==6)),
	    					//	array('label'=>Yii::t('base','Reback equipment'), 'url'=>array('custom/search'),'visible'=>(Yii::app()->user->level()==6||Yii::app()->user->level()==1)),
	    				),'visible'=>(Yii::app()->user->level()==1) || (Yii::app()->user->level()==6)),
	        array(
				'label'=>Yii::t('base','Product Service'), 
				'icon'=>"$baseUrl".'/img/menu_icons/forms.png',
				'url'=>array('#collapse3'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'), 
				'submenuOptions'=>array('class'=>$this->id==='service' || $this->id==="package"?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse3'),
				'items'=>array(
		            array('label'=>Yii::t('base','Manage Service'), 'url'=>array('service/admin')),
					array('label'=>Yii::t('base','Manage Package'), 'url'=>array('Package/admin')),
					array('label'=>Yii::t('base','Manage IPTV Package'), 'url'=>array('Package/admin','flag'=>'TV')),
		          ),
	        	'visible'=>yii::app()->user->level()==1,
	        		),
	    		array(
	    				'label'=>Yii::t('base','Agent'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/widgets.png',
	    				'url'=>array('#collapse8'),
	    				'itemOptions'=>array('class'=>'accordion-group'),
	    				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),//|| $this->action->id==='admin' 去掉这个，有问题再加在下面
	    				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='4' || Yii::app()->user->level2()=='5'|| Yii::app()->user->level2()=='7' || $this->action->id==createagentcompany || $this->id===agentperson  || $this->action->id==viewagentequipment || $this->id===agentcompany || $this->id==='bonus' || $this->id==='rebatecommission' || $this->id==='rate' || $this->id==='fandian'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse8'),
	    				'items'=>array(
	    						array('label'=>Yii::t('base','Manage Company Agent'), 'url'=>array('User/admin','level'=>4),'visible'=>Yii::app()->user->level==1),
	    						array('label'=>Yii::t('base','Manage Personal Agent'),'url'=>array('User/admin','level'=>7),'visible'=>Yii::app()->user->level==1),
	    					//	array('label'=>Yii::t('base','Create Agent'), 'url'=>array('User/createagentcompany'),'visible'=>Yii::app()->user->level==1 ),
	    						array('label'=>Yii::t('base','Manage Staff Agent'),'url'=>array('User/admin','level'=>5),'visible'=>yii::app()->user->level==4),
	    						array('label'=>Yii::t('base','Create staff agent'),'url'=>array('user/createagentperson','level'=>5),'visible'=>yii::app()->user->level==4),
	    						//array('label'=>Yii::t('base','Manage Bonus'), 'url'=>array('Bonus/admin')),
	    						array('label'=>Yii::t('base','view Equipment'),'url'=>array('Equipment/viewagentequipment','user_id'=>yii::app()->user->id),'visible'=>Yii::app()->user->level()==4 || Yii::app()->user->level()==5 || Yii::app()->user->level()==7),
	    						array('label'=>Yii::t('base','Manage Rate'), 'url'=>array('rate/admin'),'visible'=>yii::app()->user->level==1),
	    						array('label'=>Yii::t('base','Manage Fandians'), 'url'=>array('fandian/admin'),'visible'=>yii::app()->user->level==1),
	    						array('label'=>Yii::t('base','Set Rebatecommission'), 'url'=>array('Rebatecommission/show'),'visible'=>yii::app()->user->level==1),
	    						array('label'=>Yii::t('base','Manage Rebatecommission'), 'url'=>array('Rebatecommission/admin'),'visible'=>Yii::app()->user->level()==1 || yii::app()->user->level()==4 || yii::app()->user->level()==7 ),
                                                        array('label'=>Yii::t('base','Pay'), 'url'=>array('AgentRecharge/admin'),'visible'=>yii::app()->user->level()==4 || yii::app()->user->level()==7),
	    				),'visible'=>Yii::app()->user->level()==1 || yii::app()->user->level()==4 || yii::app()->user->level()==5 || yii::app()->user->level()==7 ),
	    		//合作商管理员,level = 9, 发奖员 level = 10 ,开始
	    			array(
					'label'=>Yii::t('base','Partners'),
					'icon'=>"$baseUrl".'/img/menu_icons/widgets.png',
					'url'=>array('#collapse36'),
					'itemOptions'=>array('class'=>'accordion-group'),
					'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
					'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='9' || $this->id==='awardAddress' || $this->id === 'giftPassword' || $this->id ==='activity' || $this->id==='User'||$this->action->id==='search' || $this->id === 'surveyUser'||$this->id==='giftRemainingNumber' ||$this->id==='partnerSetting'||$this->id==='partnerInfo'||$this->id==='partnerIncome'||$this->id==='partnerInvoice'||$this->id==='partnerRecord'|| $this->id === 'distributionGiftNumber' ?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse36'),
					'items'=>array(
							array('label'=>Yii::t('base','Manage Partners'), 'url'=>array('User/admin','level'=>9),'visible'=>Yii::app()->user->level()==1),
							array('label'=>Yii::t('base','Equipment Distribution'), 'url'=>array('distributionGiftNumber/admin'),'visible'=>Yii::app()->user->level()==1),
							array('label'=>Yii::t('base','Manage Partners'), 'url'=>array('User/admin'),'visible'=>Yii::app()->user->level()==9),
							array('label'=>Yii::t('base','Equipment Distribution'), 'url'=>array('giftRemainingNumber/admin','flag'=>1),'visible'=>Yii::app()->user->level()==9),
							array('label'=>Yii::t('base','Survey User'), 'url'=>array('surveyUser/admin'),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==1),
							array('label'=>Yii::t('base','Manage Promo Events'), 'url'=>array('activity/admin'),'visible'=>Yii::app()->user->level()==1),
							array('label'=>Yii::t('base','Manage Award Codes'), 'url'=>array('giftPassword/admin'),'visible'=>Yii::app()->user->level()==1),
							array('label'=>Yii::t('base','Manage Address'), 'url'=>array('awardAddress/admin'),'visible'=>Yii::app()->user->level()==9),
					        array('label'=>Yii::t('base','Partner Setting'), 'url'=>array('partnerSetting/admin'),'visible'=>yii::app()->user->level==1),
					       // array('label'=>Yii::t('base','Partner Details'), 'url'=>array('partnerInfo/admin'),'visible'=>yii::app()->user->level==1),
					        array('label'=>Yii::t('base','Partner Profit Details'), 'url'=>array('partnerIncome/admin'),'visible'=>yii::app()->user->level==1),
					        array('label'=>Yii::t('base','All Partner Invoice'),'url'=>array('partnerInvoice/admin'),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==1),
					        array('label'=>Yii::t('base','Partner Invoice'),'url'=>array('partnerRecord/admin'),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==1),
					),'visible'=>Yii::app()->user->level()==1 || Yii::app()->user->level()==9),
	    //合作商管理员结束
	    // 合作商 活动开始
	    	array(
					'label'=>Yii::t('base','Activity'),
					'icon'=>"$baseUrl".'/img/menu_icons/widgets.png',
					'url'=>array('#collapse37'),
					'itemOptions'=>array('class'=>'accordion-group'),
					'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
					'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='9' || $this->id === 'surveyUser' || $this->action->id==='search' || $this->id === 'giftPassword' || $this->id === 'activityClassify' || $this->id === 'activity' ?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse37'),
					'items'=>array(
						array('label'=>Yii::t('base','Activity Classify'), 'url'=>array('activityClassify/admin'),'visible'=>Yii::app()->user->level()==0),
						array('label'=>Yii::t('base','Manage Activity'), 'url'=>array('activity/admin'),'visible'=>Yii::app()->user->level()==9),
						array('label'=>Yii::t('base','Manage Gift Password'), 'url'=>array('giftPassword/admin'),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==10),
						array('label'=>Yii::t('base','Manage Gift Record'), 'url'=>array('giftPassword/admin1','state'=>array(1,2,3)),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==10),
					),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==10),
		// 合作商 活动结束
			array(
		'label'=>Yii::t('base','Equipment'),
		'icon'=>"$baseUrl".'/img/menu_icons/widgets.png',
		'url'=>array('#collapse7'),
		'itemOptions'=>array('class'=>'accordion-group'),
		'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
		'submenuOptions'=>array('class'=>$this->id==='equipment'&& $this->action->id!='viewagentequipment' || $this->action->id==='search' || $this->id==='vpnlist' ?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse7'),
		'items'=>array(
				array('label'=>Yii::t('base','Manage Vpnlist'), 'url'=>array('vpnlist/admin'),'visible'=>Yii::app()->user->level()==1),
				array('label'=>Yii::t('base','Manage Equipment'), 'url'=>array('Equipment/admin'),'visible'=>Yii::app()->user->level()==1),
				array('label'=>Yii::t('base','Manage unsale Custom'),'url'=>array('custom/admin','isreback'=>2)),
				array('label'=>Yii::t('base','view Equipment'),'url'=>array('Equipment/viewequipment','user_id'=>yii::app()->user->id),'visible'=>Yii::app()->user->level()==6),
				array('label'=>Yii::t('base','Reback equipment'), 'url'=>array('custom/search'),'visible'=>(Yii::app()->user->level()==6||Yii::app()->user->level()==1)),
		),'visible'=>Yii::app()->user->level()==1 || Yii::app()->user->level()==6),
			array(
		'label'=>Yii::t('base','Salesman'),
		'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
		'url'=>array('#collapse10'),
		'itemOptions'=>array('class'=>'accordion-group'),
		'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
		'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='6'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse10'),
		'items'=>array(
				array('label'=>Yii::t('base','Manage Salesman'), 'url'=>array('User/admin','level'=>6)),
				array('label'=>Yii::t('base','Set Sale Rebatecommission'), 'url'=>array('Rebatecommission/saleshow')),
				),'visible'=>Yii::app()->user->level()==1),
	    		array(
	    				'label'=>Yii::t('base','Custom'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
	    				'url'=>array('#collapse20'),
	    				'itemOptions'=>array('class'=>'accordion-group'),
	    				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
	    				'submenuOptions'=>array('class'=>$this->id==='custom' && yii::app()->user->level==4 || $this->id==='custom' && yii::app()->user->level==5 || $this->id==='custom' && yii::app()->user->level==7?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse20'),
	    				'items'=>array(
	    						array('label'=>Yii::t('base','Manage sold Custom'), 'url'=>array('custom/admin','isreback'=>0)),
	    						array('label'=>Yii::t('base','Manage Historical Custom'), 'url'=>array('custom/admin','isreback'=>1)),
	    						array('label'=>Yii::t('base','Manage unsale Custom'),'url'=>array('custom/admin','isreback'=>2)),
	    						array('label'=>Yii::t('base','Create Custom'), 'url'=>array('custom/agentcreate')),
	    						array('label'=>Yii::t('base','Reback equipment'), 'url'=>array('custom/search2')),
	    				),'visible'=>(Yii::app()->user->level()==4) || (Yii::app()->user->level()==7) || yii::app()->user->level()==5),
			array(
		'label'=>Yii::t('base','My Account'),
		'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
		'url'=>array('#collapse14'),
		'itemOptions'=>array('class'=>'accordion-group'),
		'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
		'submenuOptions'=>array('class'=>yii::app()->user->level==8 && $this->action->id!='return'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse14'),
		'items'=>array(
				array('label'=>Yii::t('base','My Account'), 'url'=>array('custom/view','id'=>$custom_id)),
				array('label'=>Yii::t('base','Recharge'), 'url'=>array('AgentRecharge/admin','flag'=>'3G')),
			),'visible'=>Yii::app()->user->level()==8),
			array(
		'label'=>Yii::t('base','Return'),
		'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
		'url'=>array('custom/return'),
		'visible'=>Yii::app()->user->level()==8),
			array(
		'label'=>Yii::t('base','Recharge'),
		'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
		'url'=>array('#collapse13'),
		'itemOptions'=>array('class'=>'accordion-group'),
		'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
		'submenuOptions'=>array('class'=>$this->id==='AgentRecharge'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse13'),
		'items'=>array(
				array('label'=>Yii::t('base','Manage Recharge'), 'url'=>array('AgentRecharge/admin')),
		),'visible'=>Yii::app()->user->level()==1),
		//电视节目
		array(
	    				'label'=>Yii::t('base','TV Show'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
	    				'url'=>array('#collapse35'),
	    				'itemOptions'=>array('class'=>'accordion-group'),
	    				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
                        'submenuOptions'=>array('class'=>$this->id==='tvshow' || $this->id==='tvchannel' || $this->id==='iptvprogramList' ||$this->id==='iptvType'||$this->id==='iptvLink'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse35'),
                'items'=>array(
	    						array('label'=>Yii::t('base','Manage TV Show'), 'url'=>array('tvshow/admin')),
	    						array('label'=>Yii::t('base','Manage TV Channel'), 'url'=>array('tvchannel/admin')),
	    						array('label'=>Yii::t('base','Manage TV Program'), 'url'=>array('iptvprogramList/admin')),
	    						array('label'=>Yii::t('base','Manage TV Type'), 'url'=>array('iptvType/admin')),
	    						array('label'=>Yii::t('base','Manage TV Link'), 'url'=>array('iptvLink/admin')),
	    				),'visible'=>(Yii::app()->user->level()==1)),
		//无线
	    		array(
	    				'label'=>Yii::t('base','Manage WIFI'),
	    				'icon'=>"$baseUrl".'/img/menu_icons/gallery.png',
	    				'url'=>array('#collapse30'),
	    				'itemOptions'=>array('class'=>'accordion-group'),
	    				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
	    				'submenuOptions'=>array('class'=>$this->id==='routersettings'||$this->id==='dnsList' ?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse30'),
	    				'items'=>array(
	    						array('label'=>Yii::t('base','Manage WIFI'), 'url'=>array('routersettings/admin')),
	    						array('label'=>Yii::t('base','Manage DNS'), 'url'=>array('dnsList/view')),
	    				),'visible'=>(Yii::app()->user->checkAccount()== true)),
			array(
				'label'=>Yii::t('base','System settings'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse2'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'&& $this->id!='rate' || $this->id==='routing' || $this->id === 'fullRouting'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse2'),
				'items'=>array(
					array('label'=>Yii::t('base','Manage Admin'), 'url'=>array('user/admin','level'=>1),'visible'=>yii::app()->user->level==1),
					array('label'=>Yii::t('base','Manage Public Routing'), 'url'=>array('Routing/admin','ispublic'=>'1','tag'=>'1'),'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)||(Yii::app()->user->level()==3)),
					array('label'=>Yii::t('base','Manage prohibited Routing'), 'url'=>array('Routing/admin','ispublic'=>'1','tag'=>'2'),'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)||(Yii::app()->user->level()==3)),
					array('label'=>Yii::t('base','Personal private Routing'), 'url'=>array('Routing/admin','ispublic'=>'0'),'visible'=>yii::app()->user->level()!=1 && ((Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)||(Yii::app()->user->level()==3))),
					array('label'=>Yii::t('base','Full Routing'), 'url'=>array('fullRouting/create'),'visible'=>yii::app()->user->level()!=1 && ((Yii::app()->user->level()==1)||(Yii::app()->user->level()==2)||(Yii::app()->user->level()==3))),
		),'visible'=>Yii::app()->user->level()==1|| Yii::app()->user->level()==2 || Yii::app()->user->level()==3),
			
				array(
				'label'=>Yii::t('base','Callcenter'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse38'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='potentialCustomers'||$this->id==='campaign'|| $this->id==='potentialCustomersList'|| $this->id==='status'||Yii::app()->user->level2()=='11'||Yii::app()->user->level2()=='12'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse38'),
				'items'=>array(
					array('label'=>Yii::t('base','Customers List'), 'url'=>array('potentialCustomersList/admin'),'visible'=>yii::app()->user->level==1),
					array('label'=>Yii::t('base','Potential Customer'), 'url'=>array('potentialCustomers/admin'),'visible'=>yii::app()->user->level==1),
					array('label'=>Yii::t('base','Telesales People'), 'url'=>array('user/admin','level'=>'12'),'visible'=>(Yii::app()->user->level()==1)),
					array('label'=>Yii::t('base','Sales manager'), 'url'=>array('user/admin','level'=>'11'),'visible'=>(Yii::app()->user->level()==1)),
					array('label'=>Yii::t('base','Sales Campaign'), 'url'=>array('campaign/admin'),'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==11)),		
					array('label'=>Yii::t('base','Report'), 'url'=>array('status/reports'),'visible'=>(Yii::app()->user->level()==1)||(Yii::app()->user->level()==11)),
		),'visible'=>Yii::app()->user->level()==1||Yii::app()->user->level()==11),
		
		array('label'=>Yii::t('base','Call'), 'url'=>array('/status/about'), 'visible'=>(Yii::app()->user->level()==12)),
		array('label'=>Yii::t('base','CallLog'), 'url'=>array('/status/callLoginAdmin','agent_id'=>Yii::app()->user->id), 'visible'=>(Yii::app()->user->level()==12)),
		array(
		'label'=>Yii::t('base','Feedback'),
		'icon'=>"$baseUrl".'/img/menu_icons/others.png',
		'url'=>array('#collapse40'),
		'itemOptions'=>array('class'=>'accordion-group'),
		'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
		'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='feedback'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse40'),
		'items'=>array(
				array('label'=>Yii::t('base','Routing Feedback'),'url'=>array('feedback/admin')),

		),'visible'=>Yii::app()->user->level()==1,

),
array(
        'label'=>Yii::t('base','Service Agreement'),
        'icon'=>"$baseUrl".'/img/menu_icons/others.png',
        'url'=>array('#collapse42'),
        'itemOptions'=>array('class'=>'accordion-group'),
        'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
        'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='record'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse42'),
        'items'=>array(
                array('label'=>Yii::t('base','Service Agreement'),'url'=>array('record/admin')),


        ),'visible'=>Yii::app()->user->level()==1,

),



//APP管理
		array(
				'label'=>Yii::t('base','APP Manager'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse41'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='application'||$this->id==='appuser'|| $this->id==='pushnote'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse41'),
				'items'=>array(
					array('label'=>Yii::t('base','ApplicationManager'), 'url'=>array('application/admin'),'visible'=>yii::app()->user->level==1),
					array('label'=>Yii::t('base','AppUserManager'), 'url'=>array('appuser/admin'),'visible'=>yii::app()->user->level==1),
					array('label'=>Yii::t('base','AppPushInformationManager'), 'url'=>array('pushnote/admin'),'visible'=>(Yii::app()->user->level()==1)),			
		),'visible'=>Yii::app()->user->level()==1),
		
		
		
		
		//Event管理
				array(
				'label'=>Yii::t('base','Event'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse39'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='event'|| $this->id==='eventField'|| $this->id==='eventCustomer'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse39'),
				'items'=>array(
					array('label'=>Yii::t('base','Manager Event'), 'url'=>array('event/admin'),'visible'=>yii::app()->user->level==1),			
				//管理员进行管理的
					array('label'=>Yii::t('EventField','Manage Event Fields'), 'url'=>array('eventField/admin'),'visible'=>yii::app()->user->level==1),			
				//合作商进行管理的	
					array('label'=>Yii::t('EventField','Manage Event Fields'), 'url'=>array('eventField/admin'),'visible'=>yii::app()->user->level==9),	
					array('label'=>Yii::t('EventCustomer','Event Customers'), 'url'=>array('eventCustomer/admin'),'visible'=>Yii::app()->user->level()==1),
		),'visible'=>Yii::app()->user->level()==1),
		
		//订单管理
			array(
				'label'=>Yii::t('Order','Orders'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse28'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='order'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse28'),
				'items'=>array(
					array('label'=>Yii::t('Order','Manage Orders'), 'url'=>array('order/admin'),'visible'=>yii::app()->user->level==1),			
		),'visible'=>Yii::app()->user->level()==1),
		
		//BNB订单管理
			array(
				'label'=>Yii::t('Nbnorder','Nbnorders'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse27'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='nbnorder'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse27'),
				'items'=>array(
					array('label'=>Yii::t('Nbnorder','Manage Nbnorders'), 'url'=>array('nbnorder/admin'),'visible'=>yii::app()->user->level==1),			
		),'visible'=>Yii::app()->user->level()==1),
		
		//合作商管理的活动
			array(
				'label'=>Yii::t('Event','Events'),
				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
				'url'=>array('#collapse28'),
				'itemOptions'=>array('class'=>'accordion-group'),
				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='event'|| $this->id==='eventGiftPassword'|| $this->id==='eventCustomer'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse28'),
				'items'=>array(
					array('label'=>Yii::t('Event','Manage Events'), 'url'=>array('event/admin'),'visible'=>yii::app()->user->level==9),			
					array('label'=>Yii::t('EventGiftPassword','Manage Award Code'), 'url'=>array('eventGiftPassword/admin'),'visible'=>yii::app()->user->level==9),	
					array('label'=>Yii::t('EventGiftPassword','Manage Gift Record'), 'url'=>array('eventGiftPassword/admin1'),'visible'=>Yii::app()->user->level()==9),
					array('label'=>Yii::t('EventCustomer','Event Customers'), 'url'=>array('eventCustomer/admin'),'visible'=>Yii::app()->user->level()==9 || Yii::app()->user->level()==1),
		),'visible'=>Yii::app()->user->level()==9),
		
		//字段模块
//			array(
//				'label'=>Yii::t('EventField','Event Fields'),
//				'icon'=>"$baseUrl".'/img/menu_icons/others.png',
//				'url'=>array('#collapse27'),
//				'itemOptions'=>array('class'=>'accordion-group'),
//				'linkOptions'=>array('class'=>'accordion-toggle widgets collapsed','data-toggle'=>'collapse','data-parent'=>'#sidebar_menu'),
//				'submenuOptions'=>array('class'=>Yii::app()->user->level2()=='1'|| $this->id==='eventField'?'accordion-body collapse in':'accordion-body collapse','id'=>'collapse27'),
//				'items'=>array(
//				//管理员进行管理的
//					array('label'=>Yii::t('EventField','Manage Event Fields'), 'url'=>array('eventField/admin'),'visible'=>yii::app()->user->level==1),			
//				//合作商进行管理的	
//					array('label'=>Yii::t('EventField','Manage Event Fields'), 'url'=>array('eventField/admin'),'visible'=>yii::app()->user->level==9),						
//		),'visible'=>Yii::app()->user->level()==9||Yii::app()->user->level()==1),
		array('label'=>Yii::t('base','Logout').'('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
		
),
)
	
 );
		
	?>
</div>
<div id="main">
  <div class="container">
    <div class="container_top">
      <?php if(isset($this->breadcrumbs)):?>
			<?php $this->widget('zii.widgets.CBreadcrumbs', array(
				'links'=>$this->breadcrumbs,
			)); ?><!-- breadcrumbs -->
		<?php endif?>
		<div class="top_right">
			 <div class="btn-group" data-toggle="buttons-radio">
	          <button class="btn <?php echo Yii::app()->language=='zh_cn'?'active':'';?>" onclick="javascript:window.location.href='<?php echo $this->createUrl('site/changeLanguage',array('hl'=>'zh_cn'));?>';">中文</button>
	          <button class="btn <?php echo Yii::app()->language=='en'?'active':'';?>" onclick="javascript:window.location.href='<?php echo $this->createUrl('site/changeLanguage',array('hl'=>'en'));?>';">English</button>
	        </div>
        </div>
    </div>
    <!-- End container_top -->
    <div id="container2">
      <?php echo $content; ?>
    </div><!--Container2 Over-->
    
  </div><!--Container Over -->
  <div id="footer">
    <p>
      &copy; NetCube 2013
    </p>
    <span class="company_logo"><a href="http://netcube.com.au"></a></span>
  </div>
</div>
</div>
<!-- /container -->
<!-- Le javascript
    ================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<?php
$cs->coreScriptPosition=CClientScript::POS_END;
$cs->registerCoreScript('jquery');
Yii::app()->clientScript->registerCoreScript('jquery');
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.sparkline.min.js',CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.sparkline.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/excanvas.compiled.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-transition.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-alert.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-modal.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-dropdown.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-scrollspy.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-tab.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-tooltip.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-popover.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-button.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-collapse.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-carousel.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/bootstrap-typeahead.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/fileinput.jquery.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/jquery-ui-1.8.23.custom.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/jquery.touchdown.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/flot/jquery.flot.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/flot/jquery.flot.stack.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/flot/jquery.flot.pie.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/flot/jquery.flot.resize.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/jquery.peity.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/datatables/js/jquery.dataTables.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/justGage.1.0.1/resources/js/raphael.2.1.0.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/justGage.1.0.1/resources/js/justgage.1.0.1.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/full-calendar/fullcalendar.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/plugins/My97DatePicker/WdatePicker.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/jnavigate.jquery.min.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/fancybox/jquery.fancybox.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/fancybox/jquery.fancybox.pack.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/jquery.sortDrag.js', CClientScript::POS_END);
$cs->registerScriptFile($baseUrl.'/js/jqery.insert.js', CClientScript::POS_END);
?>
</body>
</html>
<script type='text/javascript'>
    $(window).load(function() {
     	$('#loading').fadeOut();
    });
      $(document).ready(function() {
      $('body').css('display', 'none');
      $('body').fadeIn(500);
      //设置textarea自动增高
      if($('textarea.autogrow').length>0){
      	$('textarea.autogrow').autogrow();
      }
      //设置tooltip提示框
      if($('[rel=tooltip]').length>0){
       	 $('[rel=tooltip]').tooltip();
      }
      //设置下拉列表样式
      if($('.chzn-select').length>0){
        $(".chzn-select").chosen({
          disable_search_threshold: 10
      });
      }
	 	
	 
      $("#logo a, #sidebar_menu a:not(.accordion-toggle), a.ajx").click(function() {
      event.preventDefault();
      newLocation = this.href;
      $('body').fadeOut(500, newpage);
      });
      function newpage() {
      window.location = newLocation;
      }
      
      $('#sidebar_menu a.accordion-toggle').on('click',function(){
    		var $current = $(this);
    		var hasClassOpened = $current.closest('li').hasClass('opened');
    		$current.closest('ul').find('li.opened').removeClass('opened');
    		if(!hasClassOpened) {
    			$current.closest('li').addClass('opened');
    		}
    	});
    });
    </script>